#!/bin/sh
#desc This script should launch the tests stored in ./tests/ one by one

if test -f "$1"; then
	sudo echo "Launching tests for $1"
	echo " ---------------------------------------------------------------"
	for i in  test*; do
		if test -d "$i" ; then
			#./do_test.sh `basename $i` $1
			if ./do_test.sh `basename $i` $1; then
				echo "Test $i succeeded" > /dev/null
			else
				echo "Test $i failed!! Check if the ISO path is absolute!"
				exit 1
			fi
		#else
			#echo "No valid $i "
		fi
	done
	echo " -------------------------------------------------------------- "
	echo ""
	echo "For more details about a test, do 'cat test??/README', "
	echo "where ?? corresponds to the test number. "
else
	echo "ERROR: Invalid image file specified. The path must be absolute!"
	exit 1
fi
